<?php
/**
 * Each engineer has a duty to keep the code elegant
 * Created by wolffy.
 * Author @wolffy<13750088090@sina.cn>
 * Date: 2018/12/5
 * Time: 13:52
 */
Route::group([
    'prefix' => 'backend/user',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //用户列表
    Route::post('get_list', 'UserController@getList');
    //用户信息
    Route::post('get_info', 'UserController@info');
});

Route::group([
    'prefix' => 'backend/invited',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //邀请列表
    Route::post('get_list', 'InvitedController@directBeInvited');
});

Route::group([
    'prefix' => 'backend/repayment',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //还款列表
    Route::post('get_list', 'RepaymentController@getList');
    //还款详情
    Route::post('get_detail', 'RepaymentController@getDetail');
    Route::post('job_edit', 'RepaymentController@jobEdit');
    Route::post('job_update', 'RepaymentController@jobUpdate');
});

Route::group([
    'prefix' => 'backend/collect_money',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //收银列表
    Route::post('get_list', 'CollectMoneyController@getList');
    //收银明细
    Route::post('get_info', 'CollectMoneyController@getDetail');
});

Route::group([
    'prefix' => 'backend/personal_account',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //提现列表
    Route::post('get_list', 'PersonalAccountController@getList');
});

Route::group([
    'prefix' => 'backend/credit_card',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //信用卡列表
    Route::post('get_list', 'CreditCardController@getList');
});

Route::group([
    'prefix' => 'backend/bank_card',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //储蓄卡列表
    Route::post('get_list', 'BankCardController@getList');
});

Route::group([
    'prefix' => 'backend/card',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //银行卡列表
    Route::post('get_list', 'CardController@getList');
    Route::post('create', 'CardController@create');
    Route::post('edit', 'CardController@edit');
    Route::post('update', 'CardController@update');
    Route::post('delete', 'CardController@delete');
});

Route::group([
    'prefix' => 'backend/order',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //订单列表
    Route::post('get_list', 'OrderController@getList');
});

Route::group([
    'prefix' => 'backend/gallery',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //图库列表
    Route::post('get_list', 'GalleryController@getList');
    Route::post('create', 'GalleryController@create');
    Route::post('edit', 'GalleryController@edit');
    Route::post('update', 'GalleryController@update');
    Route::post('delete', 'GalleryController@delete');
});

Route::group([
    'prefix' => 'backend/popup',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //弹窗列表
    Route::post('get_list', 'PopupController@getList');
    Route::post('create', 'PopupController@create');
    Route::post('edit', 'PopupController@edit');
    Route::post('update', 'PopupController@update');
    Route::post('delete', 'PopupController@delete');
});

Route::group([
    'prefix' => 'backend/upload',
    'middleware' => 'api_backend_auth',
    'namespace' => 'BackendApi'
], function() {
    //上传文件
    Route::post('file', 'UploadController@upload');
});